package cn.wolfcode.wolf2w.business.api.factory;

import cn.wolfcode.wolf2w.business.api.RemoteStrategyEsService;
import cn.wolfcode.wolf2w.business.api.domain.StrategyEs;
import cn.wolfcode.wolf2w.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author : 邓风来
 * @date : 2025/9/24 9:36
 */
@Component
public class RemoteStrategyEsFallbackFactory implements FallbackFactory<RemoteStrategyEsService> {
    @Override
    public RemoteStrategyEsService create(Throwable cause) {
        return new RemoteStrategyEsService() {
            @Override
            public R<?> initStrategyEs(StrategyEs strategyEs, String source) {
                    return R.fail("初始化StrategyEs数据失败:" + cause.getMessage());
            }
        };
    }
}
